package com.wjy.common.druid;

import com.alibaba.druid.stat.DruidStatManagerFacade;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author ybxxszl
 * @desc 阿里巴巴数据源控制
 * @data 2019年4月12日
 */
@Api(tags = "阿里巴巴数据源控制")
@RestController
public class DruidController {

    @ApiOperation(value = "获取阿里巴巴数据源监控数据")
    @RequestMapping(value = "/getDruid", method = RequestMethod.GET)
    public List<Map<String, Object>> stat() {
        List<Map<String, Object>> list = DruidStatManagerFacade.getInstance().getDataSourceStatDataList();
        return list;
    }

}
